package com.abc.cloud.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.abc.cloud.common.utils.PageUtil;
import com.abc.cloud.common.utils.Query;

import com.abc.cloud.dao.ChatDetailUserDao;
import com.abc.cloud.entity.ChatDetailUserEntity;
import com.abc.cloud.service.ChatDetailUserService;


@Service("chatDetailUserService")
public class ChatDetailUserServiceImpl extends ServiceImpl<ChatDetailUserDao, ChatDetailUserEntity> implements ChatDetailUserService {

    @Override
    public PageUtil queryPage(Map<String, Object> params) {
        IPage<ChatDetailUserEntity> page = this.page(
                new Query<ChatDetailUserEntity>().getPage(params),
                new QueryWrapper<ChatDetailUserEntity>()
        );

        return new PageUtil(page);
    }

    @Override
    public void changeRead(List<Long> chatDetailIds, Long userId, Integer isRead) {
        this.baseMapper.changeRead(chatDetailIds, userId, isRead);
    }
}